/*
 * @Author: your name
 * @Date: 2021-08-24 11:03:57
 * @LastEditTime: 2021-09-02 14:36:21
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \bigdate\src\router\moudule\baseic.ts
 */

// 所欲默认目录写在此处
// 基础路由
import { Menu, RoleEnum } from '../type'
import { LAYOUT } from '../contants'
import { key } from '@/setting/locales/useI18n';
// 多页面配置
// TIP:没有特殊需求禁止在此添加路由
export const ROOT_ROUTER:Menu[] = [
    // 首页 必须存在 即使没有多个子页面
    {
        name: 'ROOT',
        icon: 'ROOT',
        path: '/',
        redirect: '/index',
                
    },
        
] 

// 单页面配置 

export const ABOUT_PATH:Menu[] = [
    {
        name: 'other',
        icon: 'aboutPage',
        path: '/other',
        component: LAYOUT,
        redirect: '/other/index',
        disable: true,
        children: [  
            {
                name: 'aboutPage',
                icon: 'aboutPage',
                path: 'index',
                component: () => import('../../views/others/aboutPage.vue'),
                disable: true,
                children: [  
                ],
                roles: [RoleEnum.SUPER, RoleEnum.TEST],
                mate: { title: 'aboutPage', router: '/other/index' },
                hideMenu: false, 
            },
        ],
        roles: [RoleEnum.SUPER, RoleEnum.TEST],
        mate: { title: 'about', router: '/other' },
        hideMenu: false,
    },
]

// 登录
export const LOGIN_PAGE:Menu[] = [
    {
        name: 'login',
        icon: 'asd',
        path: '/login',
        component: () => import('../../views/login/index.vue'),
        disable: true,
        children: [  
        ],
        roles: [RoleEnum.SUPER],
        mate: { title: 'login', router: '/login' },
        hideMenu: false,
    },
    {
        name: 'qrcode',
        icon: 'asd',
        path: '/qrcode',
        component: () => import('../../views/others/qrcode.vue'),
        disable: true,
        children: [  
        ],
        roles: [RoleEnum.SUPER],
        mate: { title: 'qrcode', router: '/qrcode' },
        hideMenu: false,
    },
    
]

// 404界面
// /:path(.*)* 匹配 只要是路由不存在 就会跳转
// 不能写入重定向写入之后会发生错误
// 由于页面加载路由会出现错误，所以不适用重定向404
export const PAGE_NOT_FOUND:Menu[] = [
    {
        name: '404',
        icon: 'asd',
        path: '/:path(.*)*',
        component: LAYOUT,
        disable: true,
        children: [  
            {
                name: '404',
                icon: 'asd',
                path: '/:path(.*)*',
                component: () => import('../../views/others/404.vue'),
                disable: true,
                children: [  
                ],
                roles: [RoleEnum.SUPER],
                mate: { title: '404' },
                hideMenu: false,
            },
        ],
        roles: [RoleEnum.SUPER],
        mate: { title: '404' },
        hideMenu: false,
    },
]
